{if $tourney eq 0}
<p>No se ha creado un torneo a&uacute;n, por lo tanto no se pueden crear jugadores</p>
{elseif $delegations eq 0}
<p>No hay delegaciones, por lo tanto no se puede crear un nuevo jugador</p>
{else}
<form id="new">
    <table>
        <tbody>
        <tr height="13">
            <td width="22%">Nombres:</td>
            <td>
                <input id="pla_first_name" name="pla_first_name" type="text" size="25" onfocus="switchColor('pla_first_name',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Apellidos:</td>
            <td>
                <input id="pla_last_name" name="pla_last_name" type="text" size="25" onfocus="switchColor('pla_last_name',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Documento:</td>
            <td>
                <input id="pla_document" name="pla_document" type="text" size="25" maxlength="10" onkeypress="return onlyNumbers(event);" onfocus="switchColor('pla_document',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">G&eacute;nero:</td>
            <td>
                <input type="radio" name="pla_gender" value="m">Masculino
                &nbsp;
                <input type="radio" name="pla_gender" value="f">Femenino
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Fecha de Nacimiento:</td>
            <td>
                <select id="day" onfocus="switchColor('day',&#034;#999999&#034;);">
                    <option value="">dd</option>
                    {section name=age1 start=1 loop=32 step=1}
                        <option value="{if $smarty.section.age1.index < 10}0{/if}{$smarty.section.age1.index}">{$smarty.section.age1.index}</option>
                    {/section}
                </select>
                <select id="month" onfocus="switchColor('month',&#034;#999999&#034;);">
                    <option value="">mm</option>
                    {section name=age2 start=1 loop=13 step=1}
                        <option value="{if $smarty.section.age2.index < 10}0{/if}{$smarty.section.age2.index}">{$smarty.section.age2.index}</option>
                    {/section}
                </select>
                <select id="year" onfocus="switchColor('year',&#034;#999999&#034;);">
                    <option value="">aaaa</option>
                    {php}
                        $year_start = date("Y")-17;
                        $i=1;
                        while($i<=7)
                        {
                            echo '<option value="'.$year_start.'">'.$year_start.'</option>';
                            $year_start--;
                            $i++;
                        }
                    {/php}
                </select>
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Delegacion:</td>
            <td>
                <select id="pla_del_id" name="pla_del_id" onfocus="switchColor('pla_del_id',&#034;#999999&#034;);">
                    <option value="">--Selecciona--</option>
                    {foreach item=del from=$delegations}
                    <option value="{$del.del_id}">{$del.del_name}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Lugar de Nacimiento:</td>
            <td>
                <input id="pla_place_birth" name="pla_place_birth" type="text" size="25" onfocus="switchColor('pla_place_birth',&#034;#999999&#034;);" />
                <span id="indicator1" style="display:none;">
                    <img src="images/spinner.gif" alt="Buscando..." align="top" />
                </span>
                <div id="choices" class="autocomplete" style="display:none;"></div>
                {literal}
                <script type="text/javascript" language="JavaScript">
                    autocompleter('pla_place_birth', 'choices', 'Player/WP_Player.php?action=11');
                </script>
                {/literal}
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Altura (mts):</td>
            <td>
                <input id="pla_height" name="pla_height" type="text" size="5" maxlength="6" onkeypress="return onlyFloatNumbers(event);" onfocus="switchColor('pla_height',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Peso (kg):</td>
            <td>
                <input id="pla_weight" name="pla_weight" type="text" size="5" maxlength="6" onkeypress="return onlyFloatNumbers(event);" onfocus="switchColor('pla_weight',&#034;#999999&#034;);" />
            </td>
        </tr>

        <tr>
            <td />
            <td>
                <input class="button" type="button" value="Crear" onclick="if(validate_player()) sendPlayer('new','content_area','Player/WP_Player.php?action=6');" />
                <input class="button" type="reset" value="Limpiar" />
            </td>
        </tr>
        </tbody>
    </table>
</form>
{/if}